$(document).ready(function () {
    nsxy.onload();
})
var nsxy = (function () {
	var init = function () {
    	layui.use('form', function(){
			  var form = layui.form
		});
    }
    return {
        onload : function () {
        	init();
            nsxy.tableDataNsxy();
            nsxy.dateShow();
            nsxy.nsxyAlert()
        },
       /*表格数据交互*/
      tableDataNsxy: function() {
 		var data = [{
 				"number": "1",
 				"djxh":"0000000",
 				"nsrNumber": "1111111",
 				"nsrName":'某某某',
 				"pjYear":"2018",
 				"pjResult":"良好",
 				"pjLevel":"B",
 				"pjMark":"80",
 				"operation":null
 			},
 			{
 				"number": "2",
 				"djxh":"0000000",
 				"nsrNumber": "1111111",
 				"nsrName":'某某某',
 				"pjYear":"2018",
 				"pjResult":"良好",
 				"pjLevel":"B",
 				"pjMark":"80",
 				"operation":null
 			},
 			{
 				"number": "3",
 				"djxh":"0000000",
 				"nsrNumber": "1111111",
 				"nsrName":'某某某',
 				"pjYear":"2018",
 				"pjResult":"良好",
 				"pjLevel":"B",
 				"pjMark":"80",
 				"operation":null
 			},
 			{
 				"number": "4",
 				"djxh":"0000000",
 				"nsrNumber": "1111111",
 				"nsrName":'某某某',
 				"pjYear":"2018",
 				"pjResult":"良好",
 				"pjLevel":"B",
 				"pjMark":"80",
 				"operation":null
 			}
 		];
 		$('#wepNsxy').DataTable({
 			"data": data,
 			"columnDefs": [
 				{
 					"targets": -1,
 					"data": null,
 					"render": function(data, type, full, meta) {
 						return '<a href="#"><span class="wep_nsxy_alertbtn btn wxl_bg_lan1">查看</span></a>'
 					}
 				}
 			],
 			"columns": [
 			    {
 					"data": "number"
 				},
 				{
 					"data": "djxh"
 				},
 				{
 					"data": "nsrNumber"
 				},
 				{
 					"data": "nsrName"
 				},
 				{
 					"data": "pjYear"
 				},
 				{
 					"data": "pjResult"
 				},
 				{
 					"data": "pjLevel"
 				},
 				{
 					"data": "pjMark"
 				},
 				{
 					"data": "operation"
 				}
 			],
// 			"paging": false,
 			"info": false,
 			"ordering": false,
 			"lengthChange": false,
 			"searching": false
 		});
     },
     /*点击操作弹出框*/
    nsxyAlert:function(){
    	$(document).on('click','.wep_nsxy_alertbtn',function(){
    		parent.cxzx.alertBox2('2016年度纳税信用评价信息','.wep_nsxy_alert')
    	})
    },
     /*日期显示*/
        dateShow:function(){
        	layui.use('laydate', function(){
			  var laydate = layui.laydate;
			  laydate.render({
			    elem: '#wep_date1'
			    ,type: 'year'
			  });
			})
        }
    }
})();